package org.nuist.repository;

import org.nuist.pojo.Snapshot;
import org.nuist.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface SnapshotRepository extends JpaRepository<Snapshot, Integer> {

    @Query(name = "findSnapshotByName",nativeQuery = true,value = "select * from `web_shell`.snapshot where name=:name")
    public Snapshot findSnapshotByName(@Param("name") String name);

    @Query(name = "findSnapshotById",nativeQuery = true,value = "select * from `web_shell`.snapshot where snapshot_id=:id")
    public Snapshot findSnapshotById(@Param("id") Integer id);

}
